import Vue from 'vue';

Vue.filter('formatDate', (val) => {
    let date = new Date(val),
        y = date.getFullYear(),
        m = (date.getMonth() + 1) > 9 ? date.getMonth() : `0${date.getMonth() + 1}`,
        d = date.getDate() > 9 ? date.getDate() : `0${date.getDate()}`;
    return `${y}-${m}-${d}`;
})
